package com.hansming.bss.modules.sfc.dao;

import java.util.Date;

import org.apache.ibatis.annotations.Param;

import com.hansming.bss.common.persistence.CrudDao;
import com.hansming.bss.common.persistence.annotation.MyBatisDao;
import com.hansming.bss.modules.sfc.entity.WxUser;

/**
 * 游客信息DAO接口
 * @author Hansming
 * @version 2017-11-28
 */
@MyBatisDao
public interface WxUserDao extends CrudDao<WxUser>{
	
	//得到用户根据openid
	public WxUser getWxUserByOpenid(@Param("openid")String openid);
	
	//存入token关联openid
	public void saveToken(@Param("token")String token,@Param("openid")String openid,@Param("datetime")String datetime,@Param("timeflag")String timeflag);	

	//根据token取出对应的时间
	public String gettimeBytoken(@Param("token")String token);
	
	//根据token去除对应openid
	public String getOpenidByToken(@Param("token")String token);
	
	//更新 token 时间
	public void updatetime(@Param("datetime")String datetime,@Param("token")String token);
	
	//根据openid 拿出对应的token
	public String gettokenbyopenid(@Param("openid")String openid);
	
	//更具openid拿到userid
	public	String getuseridbyopenid(@Param("openid")String openid);
	
	//增加验证码数据
	public void insertUserCode(@Param("uid")String uid,@Param("code")String code,@Param("date")String date,@Param("flag")String flag);
	
	public String selectcode(@Param("uid")String uid);
	
	public void updatecode(@Param("uid")String uid,@Param("code")String code,@Param("date")String date,@Param("flag")String flag);
	
	public Date chickcode(@Param("uid")String uid,@Param("code")String code);
	
	//更改验证码使用状态
	public void updateflag(@Param("uid")String uid,@Param("code")String code,@Param("flag")String flag);
}
